﻿@{
    ViewBag.Title = "_MyLayout";
}
@*<link href="~/Content/Site.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
<div class="page">
    <div id="header">
        <img width="100px" height="43px" src="../Content/Images/logo.gif">
        @Html.Partial("_LoginPartial")
    </div>
    <div id="navigation">
        <div id="helpandlogout">
            <ul>
                <li><b>Language</b>
                    <select>
                        <option>English</option>
                        <option>Tiếng Việt</option>
                    </select>
                </li>
                <li>@Html.ActionLink("Change Password", "ChangePassWord", "MSUS00") </li>
                <li>@Html.ActionLink("Log out", "Logout", "MSUS00") </li>
            </ul>
        </div>
        <div id="navi">
            @Html.Encode("Master") ->
            @Html.ActionLink("Role Management", "About", "Home")
        </div>
    </div>
    <div id="content">
        <div id="left">
            @Html.Action("CategoryMenu", "Home")
        </div>
    </div>
    <div id="main">
        @RenderBody()
        @RenderSection("featured", required: false)
    </div>
    <div id="footer">
        @RenderSection("footer", required: false)
    </div>
</div>
@RenderSection("scripts", false)
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/jqueryui")
@Scripts.Render("~/bundles/modernizr")*@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- InstanceBegin template="/Templates/TemplateKumon.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />
    <link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
    @*<link href="~/Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />*@
    <link href="~/Content/jquery-ui-1.8.5.custom.css" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <!-- InstanceBeginEditable name="head" -->
    <title>APEX VIETNAM</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="script" -->
    <script type="text/javascript">
        $(document).ready(function () {
            try {
                $("#txtFromDate").datepicker({ dateFormat: 'yy/mm/dd' });
                $("#txtToDate").datepicker({ dateFormat: 'yy/mm/dd' });
                $("#txtSpecifyDate").datepicker({ dateFormat: 'yy/mm/dd' });

                $(".hasDatepicker").datepicker({ dateFormat: 'yy/mm/dd' });
            } catch (e) {
                alert(e);
            }


        });
        /*Begin Check All*/
        function getValueEdit(id) {
            var field = document.getElementById(id);
            var hfValue = $("#hdfRecordId").val();
            var flag = false;
            if (hfValue && hfValue !== '') {
                var n = hfValue.split(";");
                if (n.length == 2) {
                    $("#" + id).val(n[0]);
                    flag = true;
                }
                else {
                    alert("Chon chua dung!");
                }
            }
            else {
                alert("Vui long chon");
            }
            return flag;
        }
        function getValueDelete(id) {
            var field = document.getElementById(id);
            var hfValue = $("#hdfRecordId").val();
            var flag = false;
            if (hfValue && hfValue !== '') {
                var n = hfValue.split(";");
                if (n.length >= 2) {
                    $("#" + id).val(hfValue);
                    flag = true;
                }
            }
            if (flag == false) {
                alert("Vui long chon!");
                return false;
            }
            else {
                return confirm('Ban that su muon xoa?');
            }
        }
        function selectItem(id) {
            var checkItem = document.getElementById(id);
            var checkAll = document.getElementById('chkAllItem');
            var recordId = $("#hdfRecordId").val();
            if (checkItem.checked == false) {
                checkAll.checked = false;
                recordId = recordId.replace(id + ";", "");
                $("#hdfRecordId").val(recordId);
            }
            else {
                if (recordId.indexOf(id + ";") == -1) {
                    recordId += id + ";";
                }
                $("#hdfRecordId").val(recordId);
                var table = document.getElementById('tableData');
                var inputs = table.getElementsByTagName('input');
                var check = true;
                var recordId = '';
                for (var i = 0; i < inputs.length; i++) {
                    if (inputs[i].type == 'checkbox' && inputs[i].id != 'chkAllItem') {
                        if (inputs[i].checked == false) {
                            check = false;
                            break;
                        }
                    }
                }

                if (check == true) {
                    checkAll.checked = true;
                }
                else {
                    checkAll.checked = false;
                }
            }

        }

        function selectAll() {
            var checkAll = document.getElementById('chkAllItem');
            var table = document.getElementById('tableData');
            var inputs = table.getElementsByTagName('input');
            var recordId = '';
            if (checkAll.checked == false) {

                for (var i = 0; i < inputs.length; i++) {
                    if (inputs[i].type == 'checkbox' && inputs[i].id != 'chkAllItem') {
                        inputs[i].checked = false;
                    }
                }
            }
            else {
                for (var i = 0; i < inputs.length; i++) {
                    if (inputs[i].type == 'checkbox' && inputs[i].id != 'chkAllItem') {
                        inputs[i].checked = true;
                        recordId += inputs[i].id + ";";
                    }
                }
            }
            $("#hdfRecordId").val(recordId);
        }
        /*End Check All*/

        function beginPaging(args) {
            // Animate
            $('#divList').fadeOut('normal');
        }
        function successPaging() {
            // Animate
            $('#divList').fadeIn('normal');
        }
        function failurePaging() {
            alert("Could not retrieve contacts.");
        }
        function CheckSession(data) {
            if (data.get_data() == '') {
                window.location.reload();
            }
        }
        //clear message content (when click search button)
        function clearMessage() {
            document.getElementById("error").innerHTML = '';
        }

    </script>
    @*Set value for dropdownlist in event selectedIndexChange*@
    <script language="javascript" type="text/javascript">
        $(function () {
            $('#Language').change(function () {
                try {
                    var strValue = $('#Language option:selected').val();
                    $.ajax({
                        url: '../MSUS00/CheckLanguage',
                        type: 'POST',
                        contentType: 'application/json;',
                        data: JSON.stringify({ _ValueLanguage: strValue }),
                        success: function (data) {

                            if (data.success) { //show that id is valid 
                                window.location.href = data.redirectUrl;
                            }
                            else { //show that id is not valid 
                                alert("False");
                            }
                        }
                    });
                } catch (e)
                { alert(e); }
            });
        });
    </script>
    <!-- InstanceEndEditable -->
</head>
<body>
    <!-- page start-->
    <div class="page">
        <!-- header start-->
        <div id="header">
            <div id="title">
                <img width="100px" height="43px" src="~/Content/Images/apex.png">
            </div>
            <div id="softnamedisplay">
                <p>
                    IVS Administrator</p>
                <div id="userlogined">
                    <h1>
                        Welcome,<b> IVS.</b>
                    </h1>
                </div>
            </div>
        </div>
        <!-- header end-->
        <!-- navigation start-->
        <div id="navigation">
            <div id="helpandlogout">
                <ul>
                    <li><b>Language</b> 
                        @Html.DropDownList("Language", (SelectList)ViewBag.ddpLanguage)                       
                    </li>
                    <li>@Html.ActionLink("Change Password", "ChangePassWord", "MSUS00") </li>
                    <li>@Html.ActionLink("Log out", "Logout", "MSUS00") </li>
                </ul>
            </div>
            <div id="superuseroption">
            </div>
            <div id="navi">
                @Html.Encode("Master") ->
                @Html.ActionLink("Role Management", "Index", "MSRM00")
            </div>
        </div>
        <!-- navigation end-->
        <!-- content start-->
        <div id="content">
            <!-- left start-->
            <div id="left">
                @Html.Action("CategoryMenu", "Home")
            </div>
            <!-- left end-->
            <!-- main start-->
            @RenderBody()
            @RenderSection("featured", required: false)
            <!-- main end-->
        </div>
        <!-- content end-->
        <!-- footer start-->
        <div id="footer">
        </div>
        <!-- footer end-->
    </div>
    <!-- page end-->
</body>
<!-- InstanceEnd -->
</html>
